import request from '@/utils/request'

// 查询优惠卷用户关系列表
export function listCoupon(query) {
    return request({
        url: '/coupon/coupon/list',
        method: 'get',
        params: query
    })
}

// 查询优惠卷用户关系详细
export function getCoupon(userCouponId) {
    return request({
        url: '/coupon/coupon/' + userCouponId,
        method: 'get'
    })
}

// 新增优惠卷用户关系
export function addCoupon(data) {
    return request({
        url: '/coupon/coupon',
        method: 'post',
        data: data
    })
}

// 修改优惠卷用户关系
export function updateCoupon(data) {
    return request({
        url: '/coupon/coupon',
        method: 'put',
        data: data
    })
}

// 删除优惠卷用户关系
export function delCoupon(userCouponId) {
    return request({
        url: '/coupon/coupon/' + userCouponId,
        method: 'delete'
    })
}
export function getUrl() {
    return request({
        url: '/coupon/coupon/getUrl',
        method: 'get'
    })
}

export function invite(data) {
    return request({
        url: '/coupon/coupon/invite/',
        method: 'post',
        data
    })
}
export function couponSnatching(sessionId) {
    return request({
        url: '/coupon/coupon/couponSnatching/'+sessionId,
        method: 'post'
    })
}
export function findSession() {
    return request({
        url: '/coupon/coupon/findSession',
        method: 'post'
    })
}
export function Qiang(data){
    return request({
        url: '/coupon/coupon/qiang',
        method: 'post',
        data
    })
}

